BEHAVIOR "Gets the location of the center of an object."
CATEGORIES Utilities
{
to get objectCenter obj
if obj is null
set obj to target
end
get bounds of obj
set r to round(average (item 2 of it, item 4 of it))
push round(average (item 1 of it, item 3 of it)) onto r
return r
end objectCenter
}
SCRIPT "Center an object at a location"
BEHAVIOR "Sets the center of an object to a particular location."
CATEGORIES Utilities
{
to set objectCenter to loc
get bounds of target
move target to (item 1 of loc - (item 3 of it - item 1 of it) div 2),\
(item 2 of loc - (item 4 of it - item 2 of it) div 2)
end objectCenter
}
SCRIPT "Make full screen"
BEHAVIOR "Without maximizing the screen, makes the application fit in the window, and its device independent"
CATEGORIES Utilities
ARG setOff oneOf "0,4" is "0" help "You can push the borders off the edge of the screen by setting this to 4, or leave them alone by accepting the default."